//
//  SettingUpdateExplainCell.m
//  JinFuThree
//
//  Created by 毛韶谦 on 2018/9/5.
//  Copyright © 2018年 毛韶谦. All rights reserved.
//

#import "SettingUpdateExplainCell.h"

@interface SettingUpdateExplainCell ()

@property (nonatomic, strong) UIImageView *rightImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *timeLabel;

@end

@implementation SettingUpdateExplainCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(63, 63));
            make.centerY.mas_equalTo(self.contentView);
            make.right.mas_equalTo(self.contentView.mas_right).offset(-15);
        }];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.contentView.mas_left).offset(15);
            make.top.mas_equalTo(self.contentView.mas_top).offset(20);
            make.right.mas_equalTo(self.rightImageView.mas_left).offset(-15);
        }];
        [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.contentView.mas_left).offset(15);
            make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-20);
            make.right.mas_equalTo(self.rightImageView.mas_left).offset(-15);
        }];
        
        UIImageView *lineImageView = [[UIImageView alloc] init];
        lineImageView.backgroundColor = ThemeMaoLineColor;
        [self.contentView addSubview:lineImageView];
        [lineImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.bottom.mas_equalTo(self.contentView);
            make.left.mas_equalTo(self.contentView.mas_left).offset(15);
            make.height.mas_equalTo(0.7f);
        }];
        
    }
    return self;
}


- (void)updateInfoCellWithModel {
    
    self.rightImageView.image = [UIImage imageNamed:@"nameLabel nameLabel"];
    self.titleLabel.text = @"爱尚金服3.0更新内容";
    self.timeLabel.text = @"2018-08-18";
}



- (UIImageView *)rightImageView {
    
    if (!_rightImageView) {
        _rightImageView = [[UIImageView alloc] init];
        [_rightImageView setContentMode:UIViewContentModeScaleAspectFit];
        
        [self.contentView addSubview:_rightImageView];
    }
    return _rightImageView;
}
- (UILabel *)titleLabel {
    
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.textColor = HexColor(0x333333);
        _titleLabel.font = [UIFont boldSystemFontOfSize:14];
        _titleLabel.numberOfLines = 2;
        
        [self.contentView addSubview:_titleLabel];
    }
    return _titleLabel;
}
- (UILabel *)timeLabel {
    
    if (!_timeLabel) {
        _timeLabel = [[UILabel alloc] init];
        _timeLabel.textColor = HexColor(0x333333);
        _timeLabel.font = [UIFont systemFontOfSize:12];
        
        [self.contentView addSubview:_timeLabel];
    }
    return _timeLabel;
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
